<div id="subPage" data-type="studenList" class="tpl-portlet-components">
    <div class="portlet-title">
      <div class="caption font-green bold">
        <span class="am-icon-code"></span>学生列表
      </div>
    </div>
    <div class="tpl-block">
      <div class="am-g">
        <div class="am-u-sm-12 am-u-md-4">
          <div class="am-btn-toolbar">
            <div class="am-btn-group am-btn-group-xs">
              <button type="button" id="add" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</button>
              <button type="button" id="import" class="am-btn am-btn-default am-btn-secondary"><span class="am-icon-save"></span>导入</button>
              <button onclick="exportData('/stu/export')" type="button" class="am-btn am-btn-default am-btn-warning"><span class="am-icon-archive"></span>导出</button>
              <button type="button" onclick="deleteAllData('/stu/dels')" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span>清空全部</button>
            </div>
          </div>
        </div>
        <div class="am-u-sm-12 am-u-md-2">
          <div class="am-form-group">
            <select class="select-option" select-id="isSelect" data-am-selected="{btnSize: 'sm'}">
                <option value="all">全部</option>
                <option value="true">已选题</option>
                <option value="false">未选题</option>
            </select>
          </div>
        </div>
        <div class="am-u-sm-12 am-u-md-2">
          <div class="am-form-group">
            <select class="select-option" select-id="isSelectSuccess" data-am-selected="{btnSize: 'sm'}">
                <option value="all">全部</option>
                <option value="true">已确选</option>
                <option value="false">未确选</option>
            </select>
          </div>
        </div>
        <div class="am-u-sm-12 am-u-md-2">
          <div class="am-form-group">
            <select class="select-option major-select-data" select-id="majorId"  data-am-selected="{btnSize: 'sm'}">
              <option value="all">全部</option>
            </select>
          </div>
        </div>
        <div class="am-u-sm-12 am-u-md-2">
          <div class="am-input-group am-input-group-sm">
            <input type="text" id="search-input" class="am-form-field">
            <span class="am-input-group-btn">
                <button id="search-submit" class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="button"></button>
            </span>
          </div>
        </div>
      </div>
      <div class="am-g">
        <div class="am-u-sm-12">
          <table class="am-table am-table-striped am-table-hover table-main">
            <thead>
              <tr>
                <th>学号</th>
                <th>姓名</th>
                <th>专业</th>
                <th>班级</th>
                <th>选题状态</th>
                <th>操作</th>
              </tr>
            </thead>
            <div id="data-list-input">
              <input type="hidden" class="data-list-input" name="isSelect" value="" />
              <input type="hidden" class="data-list-input" name="isSelectSuccess" value="" />
              <input type="hidden" class="data-list-input" name="majorId" value="" />
            </div>
            <tbody id="data-list">


            </tbody>
          </table>
          <div class="am-cf">

            <div class="am-fr">
              <ul class="am-pagination tpl-pagination" id="data-list-page">

              </ul>
            </div>
          </div>
          <hr>
        </div>
      </div>
    </div>
    <div class="tpl-alert"></div>
  </div>
  <div class="am-popup" style="z-index:9999" id="import-popup">
  <div class="am-popup-inner">
    <div class="am-popup-hd">
      <h4 class="am-popup-title">导入学生数据</h4>
      <span data-am-modal-close class="am-close">&times;</span>
    </div>
    <div class="am-popup-bd" style="background:#fff;">
      <div class="am-form-group am-form-file" style="text-align:center;">
        <button type="button" class="am-btn am-btn-danger am-btn-sm">
          <i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
        <input id="doc-form-file" type="file" name="file" multiple>
      </div>
      <div style="background:#f2f6f9;padding:10px;">
        <p>导入数据说明</p>
        <p>导入需要上传按规定格式excel文件</p>
        <p><a id="download-file" href="学生导入事例.xls">点击下载示例文件</a></p>
     </div>
    </div>
  </div>
</div>
<div class="am-modal am-modal-no-btn" tabindex="-1" id="add-modal">
  <div class="am-modal-dialog" style="background:#fff;">
    <div class="am-modal-hd">添加学生
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
    <div class="am-modal-bd">
      <div class="tpl-block ">
        <div class="am-g tpl-amazeui-form">
          <div class="am-u-sm-12 am-u-md-9">
            <form class="am-form am-form-horizontal" id="add-form">
              <div class="am-form-group">
                <label for="user-name" class="am-u-sm-3 am-form-label">学号</label>
                <div class="am-u-sm-9">
                  <input type="text" name="username" class="form-validator" val-data="require" val-data-msg="学号不能为空" placeholder="学号" >
                </div>
              </div>
              <div class="am-form-group">
                <label for="user-name" class="am-u-sm-3 am-form-label">姓名</label>
                <div class="am-u-sm-9">
                  <input type="text" name="nickname" class="form-validator" val-data="require" val-data-msg="姓名不能为空" placeholder="姓名" >
                </div>
              </div>
              <div class="am-form-group">
                <label for="user-name" class="am-u-sm-3 am-form-label">密码</label>
                <div class="am-u-sm-9">
                  <input type="text" name="password" class="form-validator" val-data="require" val-data-msg="密码不能为空" placeholder="密码" >
                </div>
              </div>
              <div class="am-form-group">
                <label for="user-name" class="am-u-sm-3 am-form-label">联系</label>
                <div class="am-u-sm-9">
                  <input type="text" name="contact" class="form-validator" val-data="require" val-data-msg="联系方式不能为空" placeholder="联系方式" >
                </div>
              </div>
              <div class="am-form-group">
                <label for="user-name" class="am-u-sm-3 am-form-label">班级</label>
                <div class="am-u-sm-9">
                  <input type="text" name="sclass" class="form-validator" val-data="require" val-data-msg="班级不能为空" placeholder="班级" >
                </div>
              </div>
              <div class="am-form-group">
                <label for="user-name" class="am-u-sm-3 am-form-label">班级</label>
                <div class="am-u-sm-9">
                  <div class="am-form-group tpl-table-list-select">
                    <select class="major-select-data form-validator" val-data-msg="请选择专业" val-data="require" name="majorId" data-am-selected="{btnSize: 'sm'}">
                      <option value="">选择专业</option>
                    </select>
                  </div>
                </div>
              </div>
              <div class="am-form-group">
                <div class="am-u-sm-9 am-u-sm-push-3">
                  <button type="button" id="add-submit" class="am-btn am-btn-primary">添加</button>
                </div>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
  <script id="studentdataListTpl" type="text/html">
    <% for(var i=0;i<$data.length;i++){ %>
      <% if(i%2==0){%>
    <tr list-data-id="<%==$data[i].id%>">
      <td><%==$data[i].username%></td>
      <td><%==$data[i].nickname%></td>
      <td><%==$data[i].majorName%></td>
      <td><%==$data[i].sclass%></td>d>
      <%if($data[i].choose==0){%>
      <td style="color:red;">否</td>
      <%}else{%>
      <td style="color:green;">是</td>
      <%}%>
      <td>
        <div class="am-btn-toolbar">
          <div class="am-btn-group am-btn-group-xs">
            <button onclick="go('user/studentPaper?id=<%==$data[i].id%>&name=<%==$data[i].nickname%>')" class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span>查看选题</button>
            <button onclick="deleteData('/stu/del/<%==$data[i].id%>','<%==$data[i].id%>')" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"><span class="am-icon-trash-o"></span> 删除</button>
          </div>
        </div>
      </td>
    </tr>
    <%}else if(i%2==1){%>
    <tr list-data-id="<%==$data[i].id%>">
      <td><%==$data[i].username%></td>
      <td><%==$data[i].nickname%></td>
      <td><%==$data[i].majorName%></td>
      <td><%==$data[i].sclass%></td>
      <%if($data[i].choose==0){%>
      <td style="color:red;">否</td>
      <%}else{%>
      <td style="color:green;">是</td>
      <%}%>
      <td>
        <div class="am-btn-toolbar">
          <div class="am-btn-group am-btn-group-xs">
            <button onclick="go('user/studentPaper?id=<%==$data.id%>&name=<%==$data.nickname%>')"  class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span>查看选题</button>
            <button onclick="deleteData('/stu/del/<%==$data.id%>','<%==$data.id%>')" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"><span class="am-icon-trash-o"></span> 删除</button>
          </div>
        </div>
      </td>
    </tr>
    <%}}%>
  </script>
  <script id="studentdataTpl" type="text/html">
    <tr list-data-id="<%==$data.id%>">
      <td><%==$data.username%></td>
      <td><%==$data.nickname%></td>
      <td><%==$data.majorName%></td>
      <td><%==$data.sclass%></td>d>
      <%if($data.choose==0){%>
      <td style="color:red;">否</td>
      <%}else{%>
      <td style="color:green;">是</td>
      <%}%>
      <td>
        <div class="am-btn-toolbar">
          <div class="am-btn-group am-btn-group-xs">
            <button onclick="go('user/studentPaper.html?id=<%==$data.id%>&name=<%==$data.nickname%>')"  class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span>查看选题</button>
            <button onclick="deleteData('/stu/del/<%==$data.id%>','<%==$data.id%>')" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"><span class="am-icon-trash-o"></span> 删除</button>
          </div>
        </div>
      </td>
    </tr>
  </script>
  <script src="static/js/amazeui.min.js"></script>
